package org.stvd.controller.logs;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.stvd.controller.BaseController;
import org.stvd.core.dto.QueryResult;
import org.stvd.entities.logs.SysLoginInfo;
import org.stvd.service.logs.SysLoginInfoService;

/**
 * @Title: SysLoginInfoController
 * @Description: 系统登录日志控制类
 * @author houzx
 * @date 2020年9月3日
 */
@Controller
@RequestMapping("logs/logininfo")
public class SysLoginInfoController extends BaseController{

    @Autowired
    private SysLoginInfoService sysLoginInfoService;
    
    private String tmpURL = "/logs/logininfo/";
    
    /**
     * @Description: 登录日志管理
     * @param sysLoginInfo
     * @return
     */
    @RequestMapping(value="manage")
    public String onSysloginInfoManage(@ModelAttribute("sysLoginInfo") SysLoginInfo sysLoginInfo) {
        QueryResult<SysLoginInfo> queryResult = sysLoginInfoService.queryLginInfoResult((pageNo - 1) * pageSize, pageSize,
                sysLoginInfo.getUserName(), sysLoginInfo.getStatus(), sysLoginInfo.getIpaddr(), 
                sysLoginInfo.getQueryStartDate(), sysLoginInfo.getQueryEndDate());
        map.put("queryResult", queryResult);
        return tmpURL + "SysLoginInfoManage.html";
    }
}
